package com.tidemark;

import java.util.Vector;

public class DefaultDataModel implements StockDataModel {

	public final static boolean DEBUG = false;
	
	private Vector<Stock> data;
	
	public DefaultDataModel() {
		data = new Vector<Stock>();
	}
	
	@Override
	public void add(Stock stock) {
		data.add(stock);
		if(DEBUG){
			System.out.println("Added: " + stock);
		}
	}

	@Override
	public void removeAll() {
		data.removeAllElements();
		if(DEBUG){
			System.out.println("Cleaned. ");
		}
	}

	@Override
	public Object[] getAll() {
		return data.toArray();
	}

}
